<?php

class Simulacra_Core extends Simulacra_Config
{
  function isThumbnailed($size = false)
  {
    $name = $this->getThumbnailFilename($size);    
    if (file_exists($name)) {
      $this->thumb1_filename = $name;
      return true;
    } else {
      return false; 
    }
  }

  function createThumbnail($size = false)
  {
    $fn = pathinfo($this->filename);

    switch(strtolower($fn['extension'])) {
    case 'jpg':
    case 'jpeg':
      break;

    case 'gif':
      break;

    case 'png':
      break;

    default:
      break;
    }

    $name = $this->getThumbnailFilename($size);
  }

  function getThumbnailFilename($size = false) {
    $fn = pathinfo($this->filename);

    $name  = $fn['dirname'] . "/cache/";
    $name .= substr($fn['basename'], 0, 1 - strlen($fn['extension']) * -1);
    $name .= "-" . $size . "." . $fn['extension'];

    return $name;
  }
}

?>
